from rapidocr_onnxruntime import RapidOCR

_engine = RapidOCR()


def recognize(img_path):
    result, _ = _engine(img_path)

    if result:
        res_txt = ''

        for res in result:
            res_txt = res_txt + res[1]

        return res_txt
    else:
        return ''
